package src.Note.Note4;

/**
 * @Author： 20192315裴湘瑞
 * @Date: 2020/10/27 21:05
 * @Version: 1.0
 * @Target：求出1-100的累加和
 * @Requirement：定义并调用方法
 */
public class Note4 {
    public static void main(String[] args) {
        System.out.println("和为：" + getSum());
    }
    public static int getSum() {
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            sum +=i;
        }
        return sum;
    }
}
